/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fametro.model.dao;

import br.com.fametro.model.bean.Funcinario;
import br.com.fametro.model.connection.ConnectionFactory;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
/**
 *
 * @author User
 */
public class ConsultaDao {
    Session session;
    Transaction transaction;
    List<Funcinario> listaFuncinario = new ArrayList<Funcinario>();
    
    //método salvar
    public Funcinario consultarForNome (String nome){
      //
           session = new ConnectionFactory().getSessionFactory();
           Query query = session.createSQLQuery("SELECT * FROM funcionario WHERE nomefunc = ´"+nome+"´");
           System.out.println("SELECT * FROM bairro WHERE bainome = ´"+nome+"´");
           listaCadastro = query.list();
           return listaCadastro.get(0);
       } 
    }
    
//}
